<?php

use yii\db\Migration;

class m180124_142207_create_subsidy extends Migration
{
    public $tableName = '{{%check}}';
    
    public function safeUp()
    {
        $this->addColumn($this->tableName, 'type', $this->smallInteger(1)->notNull()->defaultValue(1)->comment('申请类型 1: 购买申请 2： 补贴申请 3: 退款申请')->after('times'));
        $this->addColumn($this->tableName, 'remark', $this->string(255)->notNull()->defaultValue('')->comment('备注')->after('type'));
    }

    public function safeDown()
    {
        $this->dropColumn($this->tableName, 'type');
        $this->dropColumn($this->tableName, 'remark');
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m180124_142207_create_subsidy cannot be reverted.\n";

        return false;
    }
    */
}
